package com.dingding.special.order.cancel.sql;

/**
 * 
 * @ClassName: CancelSpecialOrderSQL 
 * @Description: 取消专车订单SQL 
 * @author YHQ
 * @date 2016年8月22日 上午11:01:10
 * @since V2.4.0
 * 
 */
public class CancelSpecialOrderSQL {

	/**
	 * 
	 * @Title: cancelSpecialOrderNoticeInfo 
	 * @Description: 获取取消专车订单通知信息 
	 * @param cancelType 1:乘客  2:司机
	 * @author YHQ 
	 * @return String    返回类型
	 * 
	 */
	public static String cancelSpecialOrderNoticeInfo(int cancelType){
		
		StringBuilder builder = new StringBuilder();
		
		builder.append("SELECT  u.specialOrderId,u.orderStatus,u.publishType,s.aliasId,s.clientType FROM userspecialordert u  INNER JOIN specialuserlogin s ");
		
		if(cancelType == 1){
			builder.append("ON s.suid = u.grabOrderUserId ");
		}else if(cancelType == 2){
			builder.append("ON s.suid = u.placeOrderUserId ");
		}
		
		builder.append("WHERE u.specialOrderId = ?");
		
		return builder.toString();
	}
	
	/**
	 * 司机取消专车订单
	 * @author fengshuonan
	 */
	public static String CANCEL_SPECIAL_FROM_DRIVER = "SELECT  u.specialOrderId as oid,u.orderStatus,u.publishType,s.aliasId,s.loginEquipment FROM userspecialordert u INNER JOIN userlogin s ON s.uid = u.placeOrderUserId WHERE u.specialOrderId = ?";
	
	
	public static void main(String[] args) {
		System.out.println(cancelSpecialOrderNoticeInfo(2));
	}
}
